package cn.com.yiqi.wsc.portal.controller.luck;

import cn.com.yiqi.wsc.portal.controller.BaseController;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by 苟宇恒 on 2017/2/23.
 * 抽奖管理
 */
@Controller
@RequestMapping("/luck")
public class LuckController extends BaseController {

    @RequestMapping("/index")
    public ModelAndView index() {
        ModelAndView mv = new ModelAndView("luck/index");
        this.getUserData(mv);
        return mv;
    }

    @RequestMapping("/add")
    public ModelAndView add(HttpServletRequest request) {
        ModelAndView mv = new ModelAndView("luck/add");
        String id = request.getParameter("id");
        if (StringUtils.isNotEmpty(id)) {
            mv.addObject("id", id);
        }
        this.getUserData(mv);
        return mv;
    }

    @RequestMapping("/detail")
    public ModelAndView detail(HttpServletRequest request) {
        ModelAndView mv = new ModelAndView("luck/detail");
        String id = request.getParameter("id");
        if (StringUtils.isNotEmpty(id)) {
            mv.addObject("id", id);
        }
        this.getUserData(mv);
        return mv;
    }
}
